	<meta charset="utf-8" />
<?php 
//取登录页表单数据
$adminname=$_POST["adminname"];
$password=$_POST["password"];
	
//连接数据库
  mysql_connect("localhost","root","1161105403");
  mysql_select_db("end_item");
  mysql_query("set names utf8");

//编写SQL语句并执行
$sql="select * from admins where adminname='$adminname' and password=md5('$password')";
$rs=mysql_query($sql);//判定结果集中的条数
$num=mysql_num_rows($rs);
if ($num>0) {
	echo '登录成功!3秒后将跳转到管理员欢迎界面';
	header("refresh:3;url='welcome.php'");
}else{	
echo "登录失败！3秒后将返回登录页重新登录";
    header("refresh:3;url='login.php'");
}
?>
	
